<!DOCTYPE html>
<html>
<head>
    <title>锐浪HTML5报表演示 - 起步例子</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <script src="../../../../scripts/boot.js" type="text/javascript"></script>
    <script src="../../../../scripts/CreateControl.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        var rowstr =localStorage.getItem('row');
        var thiseditrow =JSON.parse(rowstr);
        console.log(thiseditrow);
        var cTableNameId = thiseditrow.cTableName + '_id';
        var ReportURL="";
        function window_onload() {
            // if (typeof(thiseditrow.id)!="undefined" && thiseditrow.id !=0)
            // {
            //     thiseditrow._state="modified";
            //     $.ajax({
            //         type:"post",
            //         url: "../../designerprint/getgrfstr?id="+thiseditrow.id+"&random="+Math.random(),
            //         success: function (text) {
            //             if(text==""){
            //                 CreateReportDesign();
            //             }
            //             ReportDesigner.Report.LoadFromStr(text);
            //             ReportDesigner.Reload();
            //
            //         },
            //         error: function (jqXHR, textStatus, errorThrown) {
            //             mini.alert(jqXHR.responseText);
            //         }
            //     });
            // }else{
            //     thiseditrow._state="added";
            // }
            //创建报表显示器，参数指定其在网页中的占位标签的ID，关联的报表模板URL，关联的报表数据URL
            //var reportViewer = rubylong.grhtml5.insertReportViewer("report_holder", "../../designerprint/getgrf?id="+thiseditrow.id+"&random="+Math.random(), "");
            if(thiseditrow.pageType == '打印'){
                CreatePrintViewerEx("100%", "100%", ajaxUrl + "/printTemplate/getgrfstr?id="+thiseditrow.vouchId+"&random="+Math.random(), ajaxUrl +"/printTemplate/findDataByIdName.do?cTableName="+thiseditrow.cTableName+"&id="+thiseditrow[cTableNameId], true, "");
            }else{
                CreatePrintViewerEx("100%", "100%", ajaxUrl + "/printTemplate/getgrfstr?id="+thiseditrow.id+"&random="+Math.random(), "", true, "");
            }


            //启动报表运行，生成报表
            //reportViewer.start();
        }
    </script>
</head>
<body onload="window_onload()">
<div id="report_holder"> <!--报表占位标签，生成的报表将显示到这里-->
</div>
</body>
</html>